package manager;

import java.util.ArrayList;

import to.WorkerTO;

public class MesManager {
	private ArrayList<WorkerTO> workerList;
	private long endTime;
	private int allCount;
	private int successCount;
	private int successPer;
	private int successTime;
	private int orderId;
	
	public MesManager() {
		successPer = 0;
		successTime = 0;
		successCount = 0;
	}
	public void setWorkerList(WorkerTO wto){
		workerList.add(wto);
	}
	public ArrayList<WorkerTO> getWorkerList(){
		return workerList;
	}
	public long setResultTime(long startTime){
		endTime = System.currentTimeMillis();
		return (endTime - startTime)*1000;
	}
	public void setAllCount(int count){
		this.allCount = count;
	}
	public int getAllCount(){
		return allCount;
	}
	public void sumSuccessCount(){
		successCount = successCount+1;
	}
	public void resultSuccess(){
		successPer = successCount/allCount;
		successTime = successTime/successCount;
	}
	public void sumSuccessTime(int time){//총 소요 시간
		successTime = successTime + time;
	}
	public int getSuccessCount(){
		return successCount;
	}
	public int getSuccessPer(){
		return successPer;
	}
	public int getSuccessTime(){
		return successTime;
	}
	public int getOrderId() {
		return orderId;
	}
	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}
}
